Skip to content

Instantly share code, notes, and snippets.

@vishal2376
vishal2376 / Place.kt
Last active May 19, 2024 10:54
Image Reflection with cool animation using Jetpack Compose
data class Place(
val name: String,
val resId: Int
)
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 19, 2024 10:52
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@AzimsTech
AzimsTech / foo.md
Last active May 19, 2024 10:52
xd

Configuring TMNet UniFi ISP through OpenWrt Web Interface

UniFi is a popular internet service provider in Malaysia, and OpenWrt is a free and open-source firmware for routers that allows for greater control and customization. This tutorial will guide you through the process of configuring UniFi on your OpenWrt router using the web interface.

Step 1: Connect to your OpenWrt router

Connect your computer to the router via Ethernet cable or Wi-Fi, and access the router's web interface by typing the IP address into your web browser's address bar. The default IP address for OpenWrt is 192.168.1.1.

Step 2: Navigate to Network Interfaces

@hakerdefo
hakerdefo / sources.list
Created June 11, 2023 18:47
Debian 12 "bookworm" complete sources.list
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
@RRethy
RRethy / gist:ad8a9a3b1112a48226ec3336fa981224
Last active May 19, 2024 10:48
Seamlessly editing remote files in (Neo)Vim with Netrw and scp

Seamlessly editing remote files in (Neo)Vim with Netrw and scp

Neovim and Vim both come bundled with a standard plugin called Netrw. Netrw acts a file explorer (similar to NERDTree), but more importantly has the ability to work with scp (as well as sftp, rcp, ftp, and lots of others :h netrw-nread) to let you edit files and browse directories that are hosted on a remote machine, inside of your local Vim instance.

This is useful since you are able to use your Vim setup and plugins without copying over your dotfiles to the remote machine. As well, since the file is copied to your local machine, there will be no delay when typing.

Setup

This is optional for Vim, but required for Neovim (check this Neovim issue explaining why).

@dhh
dhh / linux-setup.sh
Last active May 19, 2024 10:48
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl btop \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@zapisnicar
zapisnicar / telegram_bot.md
Last active May 19, 2024 10:47
How to create Telegram bot and send messages to group

How to create Telegram Bot and send messages to your group

  1. Create Telegram bot:

    Search for user @BotFather in Telegram app. Type /help in BotFather chat and wait for the reply. Type in the chat:

    /newbot

or select /newbot command from Help text. Answer few setup questions:

@mobius
mobius / libzip_simple.c
Last active May 19, 2024 10:47
using libzip to extract files
/* Copyright (C) 2011 rocenting#gmail.com */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/resource.h>
@clalancette
clalancette / ziptest.cc
Last active May 19, 2024 10:47
libzip example to create archive
// Copyright (c) 2018, Chris Lalancette
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active May 19, 2024 10:45
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}